package org.example.wx.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.example.common.utils.ResponseUtil;
import org.example.db.entity.Ad;
import org.example.db.mapper.AdMapper;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@Api(tags = "广告管理")
@RequestMapping("/wx/ad")
public class WxAdController {

    AdMapper adMapper;

    public WxAdController(AdMapper adMapper) {
        this.adMapper = adMapper;
    }

    @GetMapping("/list")
    @ApiOperation("广告列表")
    public Object list(){

        List<Ad> ads = adMapper.selectList(null);
        return ResponseUtil.ok(ads);
    }
}
